package glasspanel.MouseCursor;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Toolkit;

import javax.swing.AbstractListModel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.WindowConstants;

import swinglayout.GroupLayout;
import swinglayout.LayoutStyle;

/**
 * 
 */
public class ApplicationFrame extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public ApplicationFrame() {
		initComponents();
		setGlassPane(new WatermarkGlassPane());
		getGlassPane().setVisible(true);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	// <editor-fold defaultstate="collapsed" desc=" Generated Code
	// ">//GEN-BEGIN:initComponents
	private void initComponents() {
		JLabel jLabel1;
		JLabel jLabel2;
		JLabel jLabel3;
		JLabel jLabel4;
		JLabel jLabel5;
		JList jList1;
		JScrollPane jScrollPane1;
		JScrollPane jScrollPane2;
		JTextArea jTextArea1;
		JTextField jTextField1;
		JTextField jTextField2;
		JTextField jTextField3;
		JTextField jTextField4;

		jScrollPane1 = new JScrollPane();
		jList1 = new JList();
		jLabel1 = new JLabel();
		jLabel2 = new JLabel();
		jLabel3 = new JLabel();
		jLabel4 = new JLabel();
		jLabel5 = new JLabel();
		jTextField1 = new JTextField();
		jTextField2 = new JTextField();
		jTextField3 = new JTextField();
		jTextField4 = new JTextField();
		jScrollPane2 = new JScrollPane();
		jTextArea1 = new JTextArea();

		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		setTitle("Glass Pane and Mouse Cursor");
		jList1.setModel(new AbstractListModel() {
			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;
			String[] strings = { "Jean-Baptiste Freymann", "Nicolas Igot",
					"Matthieu Grandvallet", "Fr\u00e9d\u00e9ric Hofmann" };

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		jList1.setSelectedIndex(0);
		jScrollPane1.setViewportView(jList1);

		jLabel1.setText("First Name");

		jLabel2.setText("Last Name");

		jLabel3.setText("Phone");

		jLabel4.setText("Email");

		jLabel5.setText("Address");

		jTextField1.setText("Jean-Baptiste");

		jTextField2.setText("Freymann");

		jTextField3.setText("(555) 462-1492");

		jTextField4.setText("roukin@acme.com");

		jTextArea1.setColumns(15);
		jTextArea1.setRows(5);
		jTextArea1.setText("462 Park View Drive\n54999 Santa Clara, CA\nUSA");
		jScrollPane2.setViewportView(jTextArea1);

		GroupLayout layout = new GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.LEADING).add(
				layout.createSequentialGroup().addContainerGap().add(
						jScrollPane1, GroupLayout.PREFERRED_SIZE, 152,
						GroupLayout.PREFERRED_SIZE).addPreferredGap(
						LayoutStyle.RELATED).add(
						layout.createParallelGroup(GroupLayout.LEADING).add(
								GroupLayout.TRAILING, jLabel5).add(
								GroupLayout.TRAILING, jLabel4).add(
								GroupLayout.TRAILING, jLabel3).add(
								GroupLayout.TRAILING, jLabel2).add(
								GroupLayout.TRAILING, jLabel1))
						.addPreferredGap(LayoutStyle.RELATED).add(
								layout.createParallelGroup(GroupLayout.LEADING,
										false).add(jTextField1,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE).add(
										jTextField2,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE).add(
										jTextField3,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE).add(
										jTextField4,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE).add(
										jScrollPane2,
										GroupLayout.PREFERRED_SIZE, 209,
										GroupLayout.PREFERRED_SIZE))
						.addContainerGap()));

		layout
				.linkSize(new Component[] { jScrollPane2, jTextField1,
						jTextField2, jTextField3, jTextField4 },
						GroupLayout.HORIZONTAL);

		layout
				.setVerticalGroup(layout
						.createParallelGroup(GroupLayout.LEADING)
						.add(
								layout
										.createSequentialGroup()
										.addContainerGap()
										.add(
												layout
														.createParallelGroup(
																GroupLayout.LEADING)
														.add(
																layout
																		.createSequentialGroup()
																		.add(
																				layout
																						.createParallelGroup(
																								GroupLayout.BASELINE)
																						.add(
																								jLabel1)
																						.add(
																								jTextField1,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				LayoutStyle.RELATED)
																		.add(
																				layout
																						.createParallelGroup(
																								GroupLayout.BASELINE)
																						.add(
																								jLabel2)
																						.add(
																								jTextField2,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				LayoutStyle.RELATED)
																		.add(
																				layout
																						.createParallelGroup(
																								GroupLayout.BASELINE)
																						.add(
																								jLabel3)
																						.add(
																								jTextField3,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				LayoutStyle.RELATED)
																		.add(
																				layout
																						.createParallelGroup(
																								GroupLayout.BASELINE)
																						.add(
																								jLabel4)
																						.add(
																								jTextField4,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				LayoutStyle.RELATED)
																		.add(
																				layout
																						.createParallelGroup(
																								GroupLayout.LEADING)
																						.add(
																								jLabel5)
																						.add(
																								jScrollPane2,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE)))
														.add(
																jScrollPane1,
																GroupLayout.DEFAULT_SIZE,
																210,
																Short.MAX_VALUE))
										.addContainerGap()));
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setBounds((screenSize.width - 489) / 2, (screenSize.height - 266) / 2,
				489, 266);
	}// </editor-fold>//GEN-END:initComponents

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				new ApplicationFrame().setVisible(true);
			}
		});
	}

	// Variables declaration - do not modify//GEN-BEGIN:variables
	// End of variables declaration//GEN-END:variables

}
